package io;

import java.io.File;
import java.io.IOException;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 晓星航
 * Date: 2023-08-07
 * Time: 10:18
 */
public class IODemo1 {
    public static void main(String[] args) throws IOException {
        File file = new File("d:/test.txt");
        System.out.println(file.getName());
        System.out.println(file.getParent());//获取到父级路径
        System.out.println(file.getPath());//获取到完整路径
        System.out.println(file.getAbsolutePath());//获取到绝对路径
        System.out.println(file.getCanonicalPath());//获取到绝对路径的检查路径
    }
}
